﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Windows.Forms;
using System.Data;

namespace IEQ_Superintendencia.Services.Persistence
{
    public class DAOCulto
    {
        public static DataSet SelectPastoresPresentes(int _culto_id)
        {
            DataSet dsPastPres = null;
            SqlConnection myConn = null;
            
            try
            {
                myConn = BDConexao.getInstance().getConnection();
                SqlCommand myCom = new SqlCommand("SELECT_PASTORES_PRESENTES", myConn);
                myCom.CommandType = System.Data.CommandType.StoredProcedure;
                myCom.Parameters.AddWithValue("CULTOID", _culto_id);

                SqlDataAdapter myAdap = new SqlDataAdapter();
                myAdap.SelectCommand = myCom;
                myAdap.Fill(dsPastPres);
                
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace);
            }

            return dsPastPres;
        }


    }
}
